<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body,
        html {
            width: 100%;
            height: 100%;
            font-family: Arial, sans-serif;
            background-color: #e6f2ff;
        }

        .navbar {
            width: 100%;
            height: 55px;
            background-color: #007bff;
            overflow: hidden;
        }

        .navbar a {
            display: inline-block;
            width: 110px;
            color: white;
            font-size: large;
            line-height: 50px;
            text-decoration: none;
            text-align: center;
            transition: background-color 0.3s ease;
        }

        .navbar a:hover,
        .navbar .login:hover {
            background-color: #0056b3;
        }

        .navbar .login {
            float: right;
        }

        .login-container {
            width: 100%;
            max-width: 400px;
            margin: 100px auto 0;
            padding: 20px;
            background: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            text-align: center;
        }

        .login-container h2 {
            margin-bottom: 20px;
        }

        .login-container form {
            display: flex;
            flex-direction: column;
        }

        .login-container input[type="text"],
        .login-container input[type="password"] {
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }

        .login-container button {
            padding: 10px;
            margin-bottom: 10px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .login-container button:hover {
            background-color: #0056b3;
        }

        .login-container .forgot-password,
        .login-container .register {
            margin-top: 10px;
        }

        .login-container .forgot-password a,
        .login-container .register a {
            color: #007bff;
            text-decoration: none;
        }

        .login-container .forgot-password a:hover,
        .login-container .register a:hover {
            text-decoration: underline;
        }

        .login-container .social-login {
            margin-top: 15px;
        }

        .login-container .social-login a {
            display: inline-block;
            margin: 0 5px;
            color: #fff;
            padding: 10px;
            border-radius: 4px;
            text-decoration: none;
        }

        .login-container .social-login i {
            margin-right: 5px;
        }

        .login-container .social-login .qq {
            background-color: #3a77ed;
        }

        .login-container .social-login .wechat {
            background-color: #4caf50;
        }

        .login-container .social-login a:hover {
            opacity: 0.9;
        }

        @media only screen and (max-width: 768px) {
            .navbar a {
                width: 100%;
                padding: 10px 0;
            }

            .navbar .login {
                float: none;
                width: 100%;
            }

            .login-container {
                margin-top: 50px;
            }
        }
    </style>
</head>

<body>
    <div class="navbar">
        <a href="/"><i class="fas fa-home"></i> 首页</a>
        <a href="/all_questions"><i class="fas fa-list"></i> 题库</a>
        <a href="/race"><i class="fas fa-trophy"></i> 竞赛</a>
        <a href="#"><i class="fas fa-comments"></i> 讨论</a>
        <a href="#"><i class="fas fa-briefcase"></i> 求职</a>
        <a class="login" href="/login"><i class="fas fa-sign-in"></i> 登录</a>
    </div>

    <div id="loginForm" class="login-container">
        <h2>登录</h2>
        <form action="/login" method="post">
            <input type="text" name="username" placeholder="用户名" required>
            <input type="password" name="password" placeholder="密码" required>
            <button type="submit">登录</button>
        </form>
        <div class="forgot-password">
            <a href="#">忘记密码？</a>
        </div>
        <div class="register">
            <a href="#">注册新账户</a>
        </div>
        <div class="social-login">
            <a href="#" class="qq"><i class="fab fa-qq"></i> QQ登录</a>
            <a href="#" class="wechat"><i class="fab fa-weixin"></i> 微信登录</a>
        </div>
    </div>
</body>

</html>